<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateMoonRabbitLogTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('moon_rabbit_log', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('user_id')->comment('用户id')->index();
            $table->unsignedInteger('invite_num')->default(0)->comment('邀请用户数量');
            $table->unsignedInteger('rabbit_num')->default(0)->comment('总玉兔数量');
            $table->unsignedInteger('consumer_card_num')->default(0)->comment('兑换名片消费数量');
            $table->unsignedInteger('consumer_intimacy_num')->default(0)->comment('兑换亲密值消费数量');
            $table->unsignedInteger('real_num')->default(0)->comment('剩余玉兔数量');
            $table->timestamp('created_at')->default(\Illuminate\Support\Facades\DB::raw("CURRENT_TIMESTAMP"))->comment('创建时间');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('moon_rabbit_log');
    }
}
